#include<iostream>
using namespace std;
typedef long long LL;
const int N = 1e5 + 10, mod = 998244353;
LL n, p;
LL fun(LL a, LL b)
{
	LL res = 1;
	while (b) {
		if (b & 1) {
			res = res * a % mod;
		}
		a = (a * a % mod) % mod;
		b >>= 1;
	}
	return res;
}
int main()
{
	cin >> n >> p;
	LL ans = 1;
	for (int i = 1; i <= n; i++) {
		LL x;
		cin >> x;
		ans = ans * (fun(p, x) + 1) % mod;
	}
	cout << ans << endl;
	return 0;
}